<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>程序猴后台管理系统</title>
	<meta name="keywords" content="管理员登录系统" />
    <meta name="description" content="管理员登录系统" />
    <meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="Author" content="larry" />
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="Shortcut Icon" href="/favicon.ico" />
	<!-- load css -->
	<link rel="stylesheet" type="text/css" href="/static/admin/common/layui/css/layui.css" media="all">
	<link rel="stylesheet" type="text/css" href="/static/admin/common/css/global.css" media="all">
	<link rel="stylesheet" type="text/css" href="/static/admin/common/css/animate.css" media="all">
	<link rel="stylesheet" type="text/css" href="/static/admin/backstage/css/login.css" media="all">
	<!--  赞组件 -->
	<!--必填-->
	<meta property="og:type" content="webpage" />
	<meta property="og:url" content="网页唯一URL地址，请勿携带统计代码，分页网址请统一填写第一页链接" />
	<meta property="og:title" content="网页标题，不建议携带网站名称等SEO信息" />
	<meta property="og:description" content="网页描述，将直接显示在微博里，建议完整填写，不要重复填写标题" />
	<html xmlns:wb=“http://open.weibo.com/wb”>
	<script src="http://tjs.sjs.sinajs.cn/open/api/js/wb.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<video class="video-player" preload="auto" autoplay="autoplay" loop="loop" data-height="1080" data-width="1920" height="1080" width="1920" style="position:absolute">
	<source src="/static/admin/common/v/login.mp4" type="video/mp4">
	<!-- 此视频文件为支付宝所有，在此仅供样式参考，如用到商业用途，请自行更换为其他视频或图片，否则造成的任何问题使用者本人承担，谢谢 -->
</video>
<div class="video_mask"></div>

<div class="layui-fluid" style="position: relative;z-index:1;">
	<div class="layui-row larryms-layout">
		<div class="layui-col-lg6  layui-col-md6 layui-col-sm10 layui-col-xs11 larry-main animated shake larry-delay2">
             <div class="title">程序猴后台管理系统</div>
             <p class="info">后台登录中心</p>
             <div class="user-info">
             	  <!--<div class="avatar"><img src="images/photo/admin.png" alt=""></div>-->
             	  <form class="layui-form" action="{:url('doLogin')}" name="doLogin" method="post"  >
                        <div class="layui-form-item">
			 	             <label class="layui-form-label">用户名:</label>
			 	             <input type="text" name="uname" lay-verify="required" class="layui-input larry-input" placeholder="请输入您的用户名" id="user-name">
			            </div>
			            <div class="layui-form-item" id="password">
			 	             <label class="layui-form-label">密码:</label>
			 	             <input type="password" name="password" lay-verify="required" class="layui-input larry-input" placeholder="请输入您的登录密码" id="user-pwd">
			            </div>
			            <div class="layui-form-item larry-verfiy-code" id="larry_code">
			 	             <input type="text" name="code" id="code" lay-verfy="" lay-verify="required" autocomplete="off" class="layui-input larry-input" placeholder="输入验证码" >
			 	             <div class="code">
			 	   	             <div class="arrow"></div>
			 	   	             <div class="code-img"><img src="{:url('checkVerify')}" onclick="javascript:this.src='{:url('checkVerify')}?tm='+Math.random();" alt=""></div>
			 	             </div>
			            </div>
			            <div class="layui-form-item">
			 	            <button class="layui-btn larry-btn" type="button" id="doLogin">立即登录</button>
			            </div>
             	  </form>
             </div>
             <div class="copy-right">© 2018 程序猴 版权所有</div>
		</div>
	</div>
</div>
	<!-- 加载js文件-->
<script type="text/javascript" src="/static/admin/common/layui/layui.js"></script>
<script>
    if(window != top){
        sessionStorage.clear();
        top.location.href = location.href;
    }
    layui.cache.page = 'login';
    layui.config({
       version:"2.0.7",
       base:'/static/admin/common/'  //实际使用时，建议改成绝对路径
    }).extend({
        larry:'js/base'
    }).use('larry');
    //主动加载jquery模块

	//ajax登录
    layui.use(['jquery', 'layer'], function(){
        var $ = layui.$ //重点处
            ,layer = layui.layer;
        $('#doLogin').click(function(){
            var username = $('#user-name').val();
            var password = $('#user-pwd').val();
            var code = $('#code').val();
            //alert('22');
            $.ajax({
                type:"POST",
                url:"{:url('admin/login/dologin')}",
                dataType:"JSON",
                data:{'uname':username,'password':password,'code':code},
                success:function(data){
                    // console.log(data.code);
                    if(data.code == '-3'){
                        layer.msg(data.msg, {icon: 5});
                        //console.log(data.code);
                    }else if(data.code == '-1'){
                        layer.msg(data.msg, {icon: 5});
                    }else if(data.code == '-2'){
                        layer.msg(data.msg, {icon: 5});
                    }else if(data.code == '-6'){
                        layer.msg(data.msg, {icon: 5});
                    }else{
                        layer.msg(data.msg, {icon: 6});
                        window.location.href= "{:url('admin/index/index')}";
					}
                }
            });
        })
    });

</script>
</body>
</html>